import { Navigate, RouteDefinition } from "@solidjs/router";
import { WelcomeRoute } from "../pages/Welcome";
import { NotFoundRoute } from "../pages/Layout/404";
import { RegisterRoute } from "../pages/Register";
import { LoginRoute } from "../pages/Login";
import ManageRoutes from "../pages/manage/route";
import { lazy } from "solid-js";
import { ForgotPasswordRoute } from "@src/pages/ForgotPassword";
import { ResetPasswordRoute } from "@src/pages/ResetPassword";

const routes: RouteDefinition[] = [
    WelcomeRoute,
    {
        path: '/',
        component: lazy(() => import('@src/pages/Layout/AnonymousLayout')),
        children: [
            {
                path: '/',
                component: () => Navigate({ href: '/login' })
            },
            RegisterRoute,
            LoginRoute,
            ForgotPasswordRoute,
            ResetPasswordRoute
        ]
    },
    ManageRoutes,
    NotFoundRoute
]

export default routes
